using SqlSugar;
using System;

namespace B.S.XZYData.Domain.LJC
{
    /// <summary>
    /// 产品主数据
    /// </summary>
    [SugarTable("prd")]
    public class ProductModel
    {
        /// <summary>
        /// 主键 ID
        /// </summary>
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 产品编号
        /// </summary>
        [SugarColumn(ColumnName = "code", Length = 30, IsNullable = false)]
        public string Code { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        [SugarColumn(ColumnName = "name", Length = 100, IsNullable = false)]
        public string Name { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        [SugarColumn(ColumnName = "spec", Length = 100)]
        public string? Spec { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        [SugarColumn(ColumnName = "unit", Length = 20)]
        public string? Unit { get; set; }

        /// <summary>
        /// 
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "c_tm")]
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [SugarColumn(ColumnName = "u_tm")]
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 生产人员
        /// </summary>
        [SugarColumn(ColumnName = "producer", Length = 50)]
        public string? Producer { get; set; }

        /// <summary>
        /// 生产开始时间
        /// </summary>
        [SugarColumn(ColumnName = "prd_start_tm")]
        public DateTime ProductionStartTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 生产结束时间
        /// </summary>
        [SugarColumn(ColumnName = "prd_end_tm")]
        public DateTime ProductionEndTime { get; set; } = DateTime.Now.AddDays(1);

        /// <summary>
        /// 关联的生产计划ID
        /// </summary>
        [SugarColumn(ColumnName = "plan_id")]
        public int? PlanId { get; set; }
    }
} 